#ifndef CLSRV_H_
#define CLSRV_H_

#define _QFILE_		"requests.txt"
#define _AFILE_		"answers.txt"
#define _SRVPIDFILE_	"serverpid.txt"

#define	MAXLINE		511
	
#define _FREE_		0
#define _BOOKED_	1
#define _OCCUPIED_	2

#define MAX_NAME 80
#define MAX_TIME 60 

typedef struct request {
	char opcode;
	char guest[MAX_NAME];
	int pid;
	int room;
} requestT;

typedef struct answer {
	char opcode;
	char status;
	char guest[MAX_NAME];
	char etime[MAX_TIME];
	char ltime[MAX_TIME];
	int room;
} answerT;

enum {RESERVE=1, OCCUPY, FREE, LIST};
enum {OK=0, EOPEN_DB, EINCON_DB, ELOCK_DB, EOCCUP_ROOM, EFREE_ROOM, ELIST_ROOM,
		EBOOK_ROOM, ENOT_BOOK, ENOT_OCCUP, ENO_BOOK_OCCUP, ENO_FREE, ENO_BOOK, 
		EOPCODE};

#endif /*CLSRV_H_*/
